<template>
    <div class="dy_master">
        <div class="dy_master_index">
            <!-- <router-view /> -->
            <div v-show="index=='recommend'">
                <index-recommend></index-recommend>
            </div>
            <div v-show="index=='sameCity'">
                <index-same-city></index-same-city>
            </div>
            <div v-show="index=='follow'">
                <index-follow></index-follow>
            </div>
            <div v-show="index=='message'">
                <index-message></index-message>
            </div>
            <div v-show="index=='me'">
                <index-me></index-me>
            </div>
        </div>

        <div class="dy_master_foot" :class="{'noIndex': index!='recommend'}">
            <ul>
                <li :class="{'current': index=='recommend'}" @click="tabClick('recommend')">
                    <label>首页</label>
                </li>
                <li :class="{'current': index=='follow'}" @click="tabClick('follow')">
                    <label>关注</label>
                </li>
                <li>
                    <label><i class="fa fa-plus-square" style="font-size: .22rem;"></i></label>
                </li>
                <li :class="{'current': index=='message'}" @click="tabClick('message')">
                    <label>消息</label>
                </li>
                <li :class="{'current': index=='me'}" @click="tabClick('me')">
                    <label>我</label>
                </li>
            </ul>
        </div>
    </div>
</template>

<script>
import indexRecommend from './recommend'
import indexSameCity from './sameCity'
import indexFollow from './follow'
import indexMessage from './message'
import indexMe from './me'
export default {
    name: 'index',
    components: {
        'index-recommend': indexRecommend,
        'index-same-city': indexSameCity,
        'index-follow': indexFollow,
        'index-message': indexMessage,
        'index-me': indexMe
    },
    data(){
        return {
            index: 'recommend'
        }
    },
    methods: {
        // 页签切换
        tabClick(n){
            this.index = n;
            
        }
    },
    mounted(){

    }
}
</script>
